pub struct Buffer {
    buf: Vec<String>,
}

impl Default for Buffer {
    fn default() -> Self {
        Self { buf: vec![] }
    }
}

impl Buffer {
    pub fn append(&mut self, line: &str) {
        self.buf.push(line.to_string());
    }

    pub fn end(&mut self) -> Vec<String> {
        let ve = self.buf.clone();
        self.buf.clear();
        ve
    }
}